package org.dtrd.modules.shop.entity.bean;

import cn.hutool.core.date.DateTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.dtrd.modules.shop.entity.po.DtrdEntShcRdOrderJoinAddress;

import java.util.Date;

/**
 * <p>
 * 订单与收货地址关联关系
 * </p>
 *
 * @author sun
 * @since 2022-07-28
 */
@Getter
@Setter
@ApiModel(value = "订单与收货地址关联关系详情")
public class OrderJoinAddressDetail {

    private Integer dataId;

    @ApiModelProperty("订单号")
    private String orderId;

    @ApiModelProperty("联系人")
    private String contactPerson;

    @ApiModelProperty("联系电话")
    private String contactPhone;

    @ApiModelProperty("收货地址")
    private String contactAddress;

    @ApiModelProperty("物流公司")
    private String logisticsName;

    @ApiModelProperty("物流单号")
    private String logisticsNo;

    @ApiModelProperty("发货时间")
    private Date logisticsTime;


    public OrderJoinAddressDetail parseFromPo(DtrdEntShcRdOrderJoinAddress po) {
        dataId = po.getDataId();
        orderId = po.getOrderId();
        contactPerson = po.getContactPerson();
        contactPhone = po.getContactPhone();
        contactAddress = po.getContactAddress();
        logisticsName = po.getLogisticsName();
        logisticsNo = po.getLogisticsNo();
        logisticsTime = po.getLogisticsTime();
        return this;
    }

    // TODO 自动完成定时任务，关闭订单定时任务，订单退款
}
